import React, { Component } from 'react'
import PropTypes from 'prop-types';


export class TabCont extends Component {
    render() {
        const { list, activeId } = this.props;
        let newArr = list.find(item => {
            return item.id === activeId
        })
        return (
            <div className='TabCont'>
                <h4>{newArr && newArr.title}</h4>
                <table>
                    <thead>
                        <tr>
                            <td>变更类型</td>
                            <td>教学周期</td>
                            <td>班级</td>
                            <td>课程</td>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>{newArr && newArr.type}</td>
                            <td>{newArr && newArr.time}</td>
                            <td>{newArr && newArr.class}</td>
                            <td>{newArr && newArr.lesson}</td>
                        </tr>
                    </tbody>
                </table>
            </div>
        )
    }
}


// 数据类型校验 
TabCont.propTypes = {
    list: PropTypes.array,
};

// 设置默认值
TabCont.defaultProps = {
    list: []
};
export default TabCont